package com.li.configserve.domain.gloabreturn;

import com.li.configserve.domain.common.PageParam;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 2021/12/11 21:56
 */
public class PageInfoVO<T> implements Serializable {

    /**
     * 每页的大小
     */
    private Integer pageSize;
    /**
     * 当前页
     */
    private Integer pageNumber;
    /**
     * 总数
     */
    private long total;
    /**
     * 状态码
     */
    private Integer code;
    /**
     * 信息
     */
    private String message;
    /**
     * 分页数据
     */
    private List<T> data = new ArrayList<>();

    public PageInfoVO() {
    }

    /**
     * 初始化分页参数
     *
     * @param pageParam
     */
    public PageInfoVO(PageParam pageParam) {
        this.pageNumber = pageParam.getPageNumber();
        this.pageSize = pageParam.getPageSize();
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(Integer pageNumber) {
        this.pageNumber = pageNumber;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }
}
